import { createApp } from 'vue';
import './style.css';
import App from './App.vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
// 导入 Pinia
import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import router from './router';
import './router/initDynamicRouter.js';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

// 创建 Pinia 实例
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

// 创建 Vue 应用
const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component);
}

const call = async () => {
	app.use(pinia);
	app.use(router).use(ElementPlus).mount('#app');
};
call();
